# 突出轮廓线

import cv2
import matplotlib.pyplot as plt
import numpy as np

img = cv2.imread('D:/python/opencv-processing/laiya.jpg')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# 局部自适应
# adaptineThershold（灰度图，二值化最大值，局部二值化方法，固定二值化的方式，局部区域大小，常数）
# cv2.ADAPTIVE_THRESH_MEAN_C 均值法     cv2.ADAPTIVE_THRESH_GAUSSIAN_C   高斯法

b1 = cv2.adaptiveThreshold(gray,  255, cv2.ADAPTIVE_THRESH_MEAN_C,cv2.THRESH_BINARY,3,0)
b2 = cv2.adaptiveThreshold(gray,  255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,cv2.THRESH_BINARY,5,0)

plt.subplot(121)
plt.imshow(b1,cmap='gray')
plt.subplot(122)
plt.imshow(b2,cmap='gray')
# plt.show('off')
plt.show()